import { request } from "@/http/service"

export function getVideoData(data: any) {
  return request({
    url: "/video/list",
    method: "post",
    data
  })
}

export function addVideoData(data: any) {
  return request({
    url: "/video/add",
    method: "post",
    data
  })
}
export function editVideoData(data: any) {
  return request({
    url: "/video/edit",
    method: "post",
    data
  })
}
export function removeVideoData(id: string) {
  return request({
    url: `/video/delete/${id}`,
    method: "delete"
  })
}

export function batchRemoveVideoData(data: any) {
  return request({
    url: "/video/batchDelete",
    method: "post",
    data
  })
}

export function upload(data: any) {
  let headers = {}
  if (!data?.imageUrl) {
    headers = {
      "Content-Type": "multipart/form-data"
    }
  }

  return request({
    url: "/video/upload",
    method: "post",
    data,
    headers
  })
}

export function exportVideoInfo() {
  return request({
    url: "/video/download",
    method: "get"
  })
}
